<%@ page language="java" contentType="text/html; charset=windows-1255"
	pageEncoding="windows-1255"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="com.aluna.openxml.util.Accessor"%>
<%@page import="java.util.List"%>
<%@page import="com.aluna.openxml.data.StockData"%>
<%@page import="java.text.DateFormat"%>
<html>
<head>
<meta http-equiv="Content-Type"
	content="text/html; charset=windows-1255">
<title>Your Portfolio</title>
<style type="text/css">
.style1 {
	text-align: center;
}
</style>
</head>
<link rel="stylesheet" type="text/css" href="css/styles.css?v=57"
	media="all" />
<body>

<div id="ajax-poster-photo">
<div id="ajax-poster-photo-logo-nav-container"
	style="left: -52px; top: 0px; width: 803px"><img
	src="images/microsoft_office_logo.jpg" alt="Microsoft"
	style="width:75px;height:75px;" />
<h1 style="color: white">Your Portfolio</h1>
</div>
</div>
<table>
	<td valign="top">
	<table>
		<td width="100%">
		<div id="content">
		<div id="content-top">
		<div>
		<div><!-- top corners and border --></div>
		</div>
		</div>
		<div id="content-middle">
		<div id="content-middle2">
		<table>
		<tr>
		<td>
		<a href="index.jsp">Back</a>
		</td>
		</tr>
		</table>
		<br/>
		<img alt="" src="images/spacer.gif" width="100px" height="1px" />
		<div id="topright-decoration"></div>
		</div>
		</div>
		</div>
		</td>
	</table>

	</td>
	<td>

	<table cellpadding="0" cellspacing="0" border="0" id="layouttable">
		<tr>
			<td></td>
			<td><img alt="" src="images/spacer.gif" width="325px"
				height="1px" /></td>
		</tr>
		<tr valign="top">
			<td width="100%">
			<div id="content">
			<div id="content-top">
			<div>
			<div><!-- top corners and border --></div>
			</div>
			</div>
			<div id="content-middle">
			<div id="content-middle2">
			<div id="topright-decoration"></div>

			<table>
				<!-- MSTableType="layout" -->
				<thead>
					<tr
						style="height: 29px; border-style: solid; border-color: #648ABD; background-color: #7395C1">
						<td style="width: 81px; height: 29px" class="style1"><strong>Ticket</strong></td>
						<td style="width: 132px; height: 29px" class="style1"><strong>Purchase
						Date</strong></td>
					</tr>
				</thead>

				<%
					String fileName = request.getParameter("fileName");
					Accessor access;

					if (fileName == null || fileName.length() == 0) {
						access = (Accessor) session.getAttribute("accessor");
					} else {
						
						String path = config.getServletContext().getRealPath("/db");

						if (path == null) {
							java.net.URL url = config.getServletContext().getResource("/db");
							path = url.getPath();
						}
						
						access = new Accessor(path, fileName);
					}
					List<StockData> list = access.loadStockList();
					DateFormat format = DateFormat.getDateInstance(DateFormat.SHORT);

					for (StockData stock : list) {
				%>
				<tr>
					<td>${stock.ticket} <a
						href="details.jsp?ticket=<%= stock.getTicket()%>"><%=stock.getTicket()%></a>
					</td>

					<td><%=format.format(stock.getPurchaseDate())%></td>
				</tr>

				<%
					}
					session.setAttribute("accessor", access);
				%>



			</table>
			<br />
			</div>
			</div>
			</div>
			</td>
		</tr>
	</table>
	</td>
</table>

</body>
</html>
